package com.sansec.demo.interfaces.mqreceive;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;


/**
 * @author lichangwei
 */
@Slf4j
@RocketMQMessageListener(consumerGroup = "ccsp",
        topic = "test_topic",
        selectorType = SelectorType.TAG,
        selectorExpression="*",
        consumeMode= ConsumeMode.ORDERLY
)
@Component
public class TestRocketMQListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String receiveMsg) {
        log.info("通过stream收到消息，messageBody = {}", receiveMsg);
    }
}
